  // 计算两点之间的距离
  function calculateDistance(lat1, long1, lat2, long2) {
    let EARTH_RADIUS = 6378137; // 地球半径
    let radLat1 = lat1 * Math.PI / 180.0; //lat1 * Math.PI / 180.0=>弧度计算
    let radLat2 = lat2 * Math.PI / 180.0;
    let a = radLat1 - radLat2;
    let b = long1 * Math.PI / 180.0 - long2 * Math.PI / 180.0;
    let s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
    const distance = Math.round(s * EARTH_RADIUS)
    // console.log("s", s, distance)

    return distance
  }

  exports.calculateDistance = calculateDistance